package com.hmall.api.client;

import com.hmall.api.domain.dto.OrderFormDTO;
import com.hmall.api.domain.vo.OrderVO;
import com.hmall.common.utils.BeanUtils;
import feign.Param;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * 订单管理接口
 */
@FeignClient("trade-service")
public interface TradeClient {

    //根据id查询订单
    @GetMapping("/orders/{id}")
    public OrderVO queryOrderById(@Param("订单id")@PathVariable("id") Long orderId);

    //创建订单
    @PostMapping("/orders")
    public Long createOrder(@RequestBody OrderFormDTO orderFormDTO);

    //标记订单已支付
//    @ApiImplicitParam(name = "orderId", value = "订单id", paramType = "path")
    @PutMapping("/orders/{orderId}")
    void markOrderPaySuccess(@PathVariable("orderId") Long orderId);

}